package com.whity.towerdefense.model;

import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Vector;

import android.graphics.PointF;

public class Path
{
	// =============================================================
	// Private attributs
	
	// Constants
	@SuppressWarnings("unused")
	private static final String TAG = "com.djm.test03.model";
	
	private LinkedList<PointF>		m_Cells;
	
	// =============================================================
	// Public functions :
	
	public Path()
	{
		m_Cells = new LinkedList<PointF>();
	}
	
	public void PushFront(PointF p_Point)
	{
		m_Cells.addFirst(p_Point);
	}
	
	public void PushEnd(PointF p_Point)
	{
		m_Cells.addLast(p_Point);
	}
	
	public PointF GetNextPoint()
	{
		return m_Cells.peekFirst();
	}
	
	public void PointReached()
	{
		m_Cells.removeFirst();
	}
	
	public String toString()
	{
		String res = "";
		
		Iterator<PointF> ite = m_Cells.iterator();
		PointF obj;
		while(ite.hasNext())
		{
			obj = ite.next();
			res += "[" + obj.x + " ; " + obj.y + "]  ";
		}
		
		return res;
	}
	
	// =============================================================
}
